<template>
  <div>
    <!-- <hello-world /> -->

    <HelloWorld msg="Welcome to Your Vue.js App" @onEmitIndex="onEmitIndex" />
    <div>{{ price | filterPrice }}</div>
  </div>
</template>

<script>
import HelloWorld from "./components/HelloWorld.vue";

export default {
  name: "App",
  components: {
    HelloWorld,
  },
  data() {
    return {
      currentIndex: 1,
      price: 5,
      articleList: ["红楼梦", "西游记", "三国演义"],
    };
  },
  filters: {
    filterPrice(price) {
      return price ? "￥" + price : "--";
    },
  },
  methods: {
    onEmitIndex(idx) {
      this.currentIndex = idx;
      console.log(this.currentIndex);
    },
  },
};
</script>


